package com.michaelbulava.TFS.tasks.connect;

import com.intellij.openapi.module.Module;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.Project;
import com.michaelbulava.TFS.Messages;
import com.michaelbulava.TFS.TFSVcsModuleComponent;
import com.michaelbulava.TFS.tasks.BackgroundableTask;
import org.jetbrains.annotations.NotNull;

/**
 * Created by MichaelA on 9/3/2015.
 */
public class ModuleConnectorTask extends BackgroundableTask{
    private final boolean mRunInBackground;
    private final boolean mReturnOnline;
    private final Module myModule;

    public ModuleConnectorTask(@NotNull Module module){
        this(module, true);
    }

    public ModuleConnectorTask(@NotNull Module module, boolean backgroundTask) {
        this(module, backgroundTask, false);
    }

    public ModuleConnectorTask(@NotNull Module module, boolean backgroundTask, boolean returnModuleOnline){
        super(module.getProject(), Messages.getString("ModuleConnectorTask.TitleFormat"), true);
        this.mRunInBackground = backgroundTask;
        this.myModule = module;
        this.mReturnOnline = returnModuleOnline;
    }

    @Override
    protected boolean runInBackground() {
        return mRunInBackground;
    }

    @Override
    public void run(ProgressIndicator indicator) {
        TFSVcsModuleComponent moduleComponent = TFSVcsModuleComponent.getInstance(myModule);
        boolean shouldConnect = false;

    }
}
